home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19970326-19970626
/
000259_news@newsmaster….columbia.edu _Sat May 31 14:55:18 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
4KB
Return-Path: <news@newsmaster.cc.columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id OAA04051
for <kermit.misc@watsun.cc.columbia.edu>; Sat, 31 May 1997 14:55:17 -0400 (EDT)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id OAA14085
for kermit.misc@watsun; Sat, 31 May 1997 14:55:17 -0400 (EDT)
Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc,comp.os.linux.misc
Subject: Re: Transmit drops the last 10-14 characters
Date: 31 May 1997 18:55:16 GMT
Organization: Columbia University
Lines: 67
Message-ID: <5mps6k$do2$1@newsmaster.cc.columbia.edu>
References: <338498B1.41C6@raleigh.ibm.com> <5m2brb$5l3$1@newsmaster.cc.columbia.edu> <338FC0D6.69AAE64D@mindspring.com>
NNTP-Posting-Host: watsun.cc.columbia.edu
Xref: news.columbia.edu comp.protocols.kermit.misc:7109 comp.os.linux.misc:196675
In article <338FC0D6.69AAE64D@mindspring.com>,
David Greeson <dgreeson@mindspring.com> wrote:
(Discussing a problem using Linux C-Kermit to transmit bytes to a
microprocessor, but the last few bytes are always lost...)
: ....
: > : set file type binary (so it will transfer a byte at a time)
: > : set flow xon
: > :
: > : Then I set the uP to receive the ascii file and type crtl-\c
: > : C-kermit> transmit foo.bar
: > :
: > : The uP receives the whole file except for the last 10-14
: > : characters. The com port has a 16550A uart.
:
: The uP is using XON/XOFF for flow control and has a 16 byte
: rcv/xmit fifos. Using port diags on the uP, I do not see
: the last 13 bytes of the file. Also the port has not
: been overrun'd. I'm downloading s-records and each line
: has a checksum which is verified.
: ...
: After the transmit finished, I typed "c" to connect and I
: could type one character and see that the uP port received
: the character. Also, if I set the uart type on the PC to
: 16450 (setserial /dev/cua1 16450), only the last byte is
: missing.
:
This reinforces my theory about a device driver bug; the last
UART buffer's worth is not being flushed out when the device is
closed.
: I'm not sure what else to try or how to verify if its a kernel
: problem.
:
Get the Kermit source code:
ftp://kermit.columbia.edu/kermit/archives/cku192.tar.gz
uncompress, untar. Edit the file ckutio.c. Find the ttres() routine
(the one that restores the modes and settings of the tty device prior to
closing it). A few lines from the top of this routine:
#ifdef NETCONN
if (netconn) return (0); /* Network connection, do nothing */
#endif /* NETCONN */
sleep(1); /* <--- Add this line */
Save the file, then "make linux". Try your application again. Does it work?
If so, this means means that tcsetattr() destroys any pending output, which
I would call a bug.
If this change did not fix your application, then look for the ttclos()
routine in the same source file (ckutio.c). A few lines from the top of
ttclos():
if (ttfdflg) /* If we inherited ttyfd from */
return(0); /* another process, don't close it. */
sleep(1); /* <--- Add this line */
Save the file, "make linux" again, repeat the experiment. If this change
fixes the problem, it means that close() does not wait for output to drain,
which I also would consider a bug.
Please let me know what you find.
- Frank